/**
 * 
 */
package br.com.skynix.tcmc.controller.rh.empresas;

import java.util.List;

import javax.annotation.Resource;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;

import org.springframework.stereotype.Controller;

import br.com.skynix.tcmc.base.managedbeans.AbstractCRUDManagedBean;
import br.com.skynix.tcmc.base.spring.IServiceAuditavel;
import br.com.skynix.tcmc.model.rh.Empresa;
import br.com.skynix.tcmc.service.rh.empresas.EmpresaService;

/**
 * @author mgrb
 * 
 */
@ManagedBean
@RequestScoped
@Controller
public class EmpresaMB extends AbstractCRUDManagedBean<Empresa> {

	@Resource
	private EmpresaService empresaService;

	/**
	 * 
	 */
	public EmpresaMB() {
		setModeloPesquisa(new Empresa());
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see br.com.skynix.tcmc.base.AbstractCRUDManagedBean#getService()
	 */
	@Override
	protected IServiceAuditavel<Empresa> getService() {
		return empresaService;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see br.com.skynix.tcmc.base.managedbeans.AbstractCRUDManagedBean#
	 * getPathParaModuloCRUD()
	 */
	@Override
	protected String getPathParaModuloCRUD() {
		return formatPath("rh/empresas/empresa_crud_view");
	}

	public List<Empresa> getListaEmpresas() {
		return empresaService.listarTodos();
	}
}
